By

Given these macros, we can now sort any list of references with Bylist, defined

#math161#
Bylist~xs = Map~Label  
    ;SPMnbsp;;SPMnbsp;;SPMnbsp;;SPMnbsp;(Insertsort~Lessthan  
    ;SPMnbsp;;SPMnbsp;;SPMnbsp;;SPMnbsp;;SPMnbsp;;SPMnbsp;;SPMnbsp;;SPMnbsp;(Map~Number~xs))  

This takes in a list of label names like 75, converts it into a list of numbers with #math162#Map~Number, sorts the resulting list with #math163#Insertsort~Lessthan, and finally converts all the numbers into labels like Label-Number-Fac-yawnwith Map~Label. For example,
#math164#
Bylist~#tex2html_wrap_indisplay2722#:#tex2html_wrap_indisplay2723##tex2html_wrap_indisplay2724#Foldr#tex2html_wrap_indisplay2725#@@6<#7#>6<#5#>#tex2html_wrap_indisplay2726#!:}<#1#><#1077#><<#1077#><#1#><1061>>[Fac-yawn, Fac-cows];SPMnbsp;;SPMnbsp;;SPMnbsp;;SPMnbsp;
  = Map~Label~(Insertsort~Lessthan  
    ;SPMnbsp;;SPMnbsp;;SPMnbsp;;SPMnbsp;(Map~Number~#tex2html_wrap_indisplay2730# : #tex2html_wrap_indisplay2731##tex2html_wrap_indisplay2732#Foldr#tex2html_wrap_indisplay2733#@@6<#7#>6<#5#>#tex2html_wrap_indisplay2734#! :}<#1#><#1093#><<#1093#><#1#><451>>[Fac - yawn, Fac - cows]))  
  = Map~Label~(Insertsort~Lessthan~#tex2html_wrap_indisplay2737# : #tex2html_wrap_indisplay2738##tex2html_wrap_indisplay2739#Foldr#tex2html_wrap_indisplay2740#@@6<#7#>6<#5#>#tex2html_wrap_indisplay2741#! :}#tex2html_wrap_indisplay2742#Number - [#tex2html_wrap_indisplay2743#Fac - yawn, Fac - cows])  
  = Map~Label~#tex2html_wrap_indisplay2746# : #tex2html_wrap_indisplay2747##tex2html_wrap_indisplay2748#Foldr#tex2html_wrap_indisplay2749#@@<<#1117#><<#1123#>#tex2html_wrap_indisplay2750#Insert#tex2html_wrap_indisplay2751#@@<<#1124#>#tex2html_wrap_indisplay2752#653>><<#1118#><<#1118#>#tex2html_wrap_indisplay2753#651>>647>><<#1113#><<#1120#>#tex2html_wrap_indisplay2754#Insert#tex2html_wrap_indisplay2755#@@<<#1121#>#tex2html_wrap_indisplay2756#667>><<#1114#><<#1114#>#tex2html_wrap_indisplay2757#665>>645>>#tex2html_wrap_indisplay2758#! :}#tex2html_wrap_indisplay2759# : #tex2html_wrap_indisplay2760##tex2html_wrap_indisplay2761#Foldr#tex2html_wrap_indisplay2762#@@6<#7#>6<#5#>#tex2html_wrap_indisplay2763#! :}#tex2html_wrap_indisplay2764#Number - [#tex2html_wrap_indisplay2765# ;SPMlt; F#tex2html_wrap_indisplay2766##tex2html_wrap_indisplay2767##tex2html_wrap_indisplay2768##tex2html_wrap_indisplay2769#ac - yawn, Fac - cows]  
  = #tex2html_wrap_indisplay2772# : #tex2html_wrap_indisplay2773##tex2html_wrap_indisplay2774#Foldr#tex2html_wrap_indisplay2775#@@<<#1159#><<#1165#>#tex2html_wrap_indisplay2776#Insert#tex2html_wrap_indisplay2777#@@<<#1166#>#tex2html_wrap_indisplay2778#653>><<#1160#><<#1160#>#tex2html_wrap_indisplay2779#651>>647>><<#1155#><<#1162#>#tex2html_wrap_indisplay2780#Insert#tex2html_wrap_indisplay2781#@@<<#1163#>#tex2html_wrap_indisplay2782#667>><<#1156#><<#1156#>#tex2html_wrap_indisplay2783#665>>645>>#tex2html_wrap_indisplay2784#! :}#tex2html_wrap_indisplay2785# : #tex2html_wrap_indisplay2786##tex2html_wrap_indisplay2787#Foldr#tex2html_wrap_indisplay2788#@@6<#7#>6<#5#>#tex2html_wrap_indisplay2789#! :}#tex2html_wrap_indisplay2790#Number - [#tex2html_wrap_indisplay2791# ;SPMlt; #tex2html_wrap_indisplay2792#Foldr#tex2html_wrap_indisplay2793#@1#tex2html_wrap_indisplay2794#Label-<#tex2html_wrap_indisplay2795#<73>>#tex2html_wrap_indisplay2796##tex2html_wrap_indisplay2797##tex2html_wrap_indisplay2798##tex2html_wrap_indisplay2799##tex2html_wrap_indisplay2800##tex2html_wrap_indisplay2801#Fac - yawn, Fac - cows]  

The TEX code for this is
verbatim81#
So we can now stick all this together, and define the macro 76 that prints out lists of references. It is
verbatim82#
So 77 is~:<#1202#><#1204#>Foldr@<#1208#>@<#1208#><#647#><<#1209#><<#1215#>Insert@<#1220#>@<#1220#><#1221#><#1221#><#1215#><#653#><<#1216#><#1216#><#1217#><#1217#>653>><#1209#><#651#><<#1210#><<#1210#><#1211#><#1211#>651>>647>><#1204#><#645#><<#1205#><<#1212#>Insert@<#1218#>@<#1218#><#1219#><#1219#><#1212#><#667#><<#1213#><#1213#><#1214#><#1214#>667>><#1205#><#665#><<#1206#><<#1206#><#1207#><#1207#>665>>645>><#1202#><#1203#><#1203#>!:}:<#1226#><#1228#>Foldr@<#1230#>@<#1230#><#697#>6<#1234#><#1236#><<#1236#><#1234#><#1235#><<#1235#>7>><#1228#><#695#>6<#1237#><#1239#><<#1239#><#1237#><#1238#><<#1238#>5>><#1226#><#1227#><#1227#>!:}Number-:;SPMlt;Foldr@<#1223#>1<#1242#>Label-<<#1242#><#1243#><<#1243#>23>><#1224#><#1224#> <#1197#><#1197#>!:}[Fac-yawn,Fac-cows]. Which is quite nice.